package com.community.zhihuishequ.view.login;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatButton;
import android.widget.EditText;

import com.blankj.utilcode.util.ToastUtils;
import com.community.zhihuishequ.R;
import com.community.zhihuishequ.db.LoginCacheDb;
import com.community.zhihuishequ.view.base.BaseActivity;
import com.community.zhihuishequ.view.home.HomeActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class LoginActivity extends BaseActivity {

    @BindView(R.id.et_account)
    EditText etAccount;
    @BindView(R.id.et_password)
    EditText etPassword;
    @BindView(R.id.btn_login)
    AppCompatButton btnLogin;
    private LoginCacheDb loginCacheDb;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        unbinder = ButterKnife.bind(this);
    }


    @OnClick(R.id.btn_login)
    public void onViewClicked() {
        loginCacheDb = new LoginCacheDb();
        loginCacheDb.setAccount(etAccount.getText().toString());
        loginCacheDb.setPassword(etPassword.getText().toString());
        startActivity(new Intent(this, HomeActivity.class));
    }
}
